﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Soft.Service
{

    /// <summary>
    /// 心跳控制处理器
    /// </summary>
    public sealed class HeartbeatRemoteControlProcessor : BaseRemoteControlProcessor
    {
     
        /// <summary>
        /// 心跳逻辑
        /// </summary>
        /// <param name="jsonParam"></param>
        /// <returns></returns>
        public override ResultJson Processing(string jsonParam)
        {
            HeartbeatCommandParams heartbeatCommandParams;
            return new ResultJson(base.ConvertParams<HeartbeatCommandParams>(jsonParam, out heartbeatCommandParams))
            {
                Json = new HeartbeatCommandResult
                {
                    Response = ~heartbeatCommandParams.Flag
                }.ToJson()
            };
        }
    }
}
